package vo

import (
	repo_model "code.gitea.io/gitea/models/repo"
	user_model "code.gitea.io/gitea/models/user"
)

// RepoDevContainerVO 描述每一项 devContainer
type RepoDevContainerVO struct {
	DevContainerId       int64  `json:"devContainerId"       xorm:"devcontainer_id"`
	DevContainerName     string `json:"devContainerName"     xorm:"devcontainer_name"`
	DevContainerHost     string `json:"devContainerHost"     xorm:"devcontainer_host"`
	DevContainerUsername string `json:"devContainerUsername" xorm:"devcontainer_username"`
	DevContainerWorkDir  string `json:"devContainerWorkDir"  xorm:"devcontainer_work_dir"`

	RepoId   int64  `json:"repoId"                     xorm:"repo_id"`
	RepoName string `json:"repoName"                   xorm:"repo_name"`
	//RepoOwnerID   int64  `json:"repo_owner_id"              xorm:"repo_owner_id"`
	RepoOwnerName   string `json:"repo_owner_name"            xorm:"repo_owner_name"`
	RepoLink        string `json:"repo_link"                  xorm:"repo_link"`
	RepoDescription string `json:"repoDescription,omitempty"  xorm:"repo_description"`

	// 实时查询获取，不再从数据库获取
	DevContainerPort uint16 `json:"devContainerPort,omitempty"`
}

// RepoDevcontainerOptions 仓库 Dev Container 条件，注意仓库的所有者可能与当前操作用户不一致！
type RepoDevcontainerOptions struct {
	Actor      *user_model.User
	Repository *repo_model.Repository
}

// CreateRepoDevcontainerOptions 创建 DevContainer 必要字段
type CreateRepoDevcontainerOptions struct {
	Actor            *user_model.User
	Repository       *repo_model.Repository
	SSHPublicKeyList []string
}
